package com.zzh.takeoutapp.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;

import com.zzh.takeoutapp.fragment.OrderFragment;
import com.zzh.takeoutapp.fragment.MineFragment;
import com.zzh.takeoutapp.fragment.HomesFragment;


/**
 * Created by qwert on 2017/7/2.
 */

public class VPAdapter extends CacheFragmentStatePagerAdapter {

    public Context context;

    public VPAdapter(FragmentManager fragmentManager, Context c) {
        super(fragmentManager);
        context = c;
    }

    public VPAdapter(FragmentManager fm) {
        super(fm);
    }


    @Override
    protected Fragment createItem(int position) {
        if (position == 0) {
            return new HomesFragment();
        } else if (position == 1) {
            return new OrderFragment();
        } else {
            return new MineFragment();
        }
    }

    @Override
    public int getCount() {
        return 3;
    }


}
